package Containers;

import CommonInterfaces.*;

public abstract class MatrixIter<E> implements IsCloneable
{
	//returns itself.
	abstract public MatrixIter<E> MoveLeft();
	abstract public MatrixIter<E> MoveRight();
	abstract public MatrixIter<E> MoveDown();
	abstract public MatrixIter<E> MoveUp();
	
	abstract public E GetValue();
	abstract public void SetValue(E value);
	abstract public MatrixIter<E> clone();
	
	public MatrixIter<E> MoveLeft (boolean isVertical)
	{
		if (isVertical)
			return MoveLeft();
		else
			return MoveUp();
	}
	
	public MatrixIter<E> MoveRight (boolean isVertical)
	{
		if (isVertical)
			return MoveRight();
		else
			return MoveDown();
	}
	

	public MatrixIter<E> MoveUp (boolean isVertical)
	{
		if (isVertical)
			return MoveUp();
		else
			return MoveLeft();
	}

	public MatrixIter<E> MoveDown (boolean isVertical)
	{
		if (isVertical)
			return MoveDown();
		else
			return MoveRight();
	}
}
